package com.bdqn.service.impl;

import com.bdqn.mapper.StockProducterMapper;
import com.bdqn.pojo.StockProducter;
import com.bdqn.service.StockProducterService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockProducterServiceImpl implements StockProducterService {
    @Autowired
    StockProducterMapper stockProducterMapper;
    public PageInfo<StockProducter> page(int pageNum, int pageSize, String producterName, String keywords, String producterTel, String status, String createTime){
        PageHelper.startPage(pageNum,pageSize);
        List<StockProducter> list=stockProducterMapper.selectAll(producterName,keywords,producterTel,status,createTime);
        PageInfo<StockProducter> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }
    public int update(StockProducter stockProducter){
        int r=stockProducterMapper.update(stockProducter);
        return r;
    }
    public int insert(StockProducter stockProducter){
        int r=stockProducterMapper.insert(stockProducter);
        return r;
    }
    public List<StockProducter> All(String producterName,String keywords,String producterTel,String status,String createTime){
        List<StockProducter> list=stockProducterMapper.selectAll(producterName,keywords,producterTel,status,createTime);
        return list;
    }
}
